package dome1;

class Dog extends Animal {
public Dog(String name,int age){
    super(name,age);
    System.out.println("Dog(String name,int age)");
}
    public void bark() {
        System.out.println(this.name + "正在旺旺叫");
    }
}

class Cat extends Animal {
    public Cat(String name, int age) {
        super(name, age);
        System.out.println("Cat(String name, int age)");
    }

    public void miaomiao() {
        System.out.println(this.name + "正在喵喵叫");
    }

}

class Animal {
    public String name;
    public int age;

    public void eat() {
        System.out.println(this.name + "正在吃饭");
    }



    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal(Stirng name,int age)");
    }
}

class Base {
    public void method() {
        System.out.println("父类");
    }
}

class Be extends Base {
    public void method() {
        System.out.println("子类");
    }

    public void test() {
        super.method();
        method();

    }
}

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("圆圆",2);

        dog.bark();
        dog.eat();
        System.out.println("===============");
        Cat cat = new Cat("菲菲",9);
        cat.miaomiao();
        cat.eat();
    }
}
